package com.extension.company.view.my.localorder.localorderfragment;

import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.extension.company.admin.R;
import com.extension.company.model.entity.SameCityOrderAllBean;
import com.extension.company.common.mvc.BaseFragment;
import com.extension.company.view.my.QuiteMoneyDetailActivity;
import com.extension.company.view.my.localorder.adapter.LocalCityQuiteMoneyAdapter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;


/**
 * 同城订单 -- 退款 fragment
 */
public class LocalCityOrderQuiteMoneyFragment extends BaseFragment {

	@BindView(R.id.quite_moneny_list)
	RecyclerView recyclerView;
	private Context context;
	private LocalCityQuiteMoneyAdapter adapter;
	private List<SameCityOrderAllBean> list = new ArrayList<>();

	public static LocalCityOrderQuiteMoneyFragment newInstance() {
		LocalCityOrderQuiteMoneyFragment fragment = new LocalCityOrderQuiteMoneyFragment();
		return fragment;
	}


	@Override
	public void init() {
		recyclerView.setLayoutManager(new GridLayoutManager(context, 1));
		adapter = new LocalCityQuiteMoneyAdapter(context, list);
		recyclerView.setAdapter(adapter);

		adapter.setAdapterClick(new LocalCityQuiteMoneyAdapter.OnListFragmentInteractionListener() {
			@Override
			public void onListFragmentInteraction() {

			}

			@Override
			public void onItemClick(int position) {
				Intent intent = new Intent(context, QuiteMoneyDetailActivity.class);
				startActivity(intent);
			}
		});
	}

	@Override
	public int getMainLayout() {
		return R.layout.fragment_fragmentquitemoney_list;
	}


	@Override
	public void onAttach(Context context) {
		super.onAttach(context);
		this.context = context;
	}


}
